
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.2 注册验证码 · Laravel学习-从零开发论坛系统</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="kaleozhou">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="3.html" />
    
    
    <link rel="prev" href="1.html" />
    

    
        <link rel="shortcut icon" href='../book.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../book.ico' type="image/x-icon">
    
    
        <link rel="apple-touch-icon" href='../book.ico'>
    
    
        
        <link rel="apple-touch-icon" sizes="120x120" href="../book.ico">
        
        <link rel="apple-touch-icon" sizes="180x180" href="../book.ico">
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.kaleozhou.top" target="_blank" class="custom-link">我的博客</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    序言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1/1.html">
            
                <a href="../chapter1/1.html">
            
                    
                    第一章 开发环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter2/readme.html">
            
                <a href="../chapter2/readme.html">
            
                    
                    第二章 创建应用及布局
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter2/1.html">
            
                <a href="../chapter2/1.html">
            
                    
                    2.1 创建应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter2/2.html">
            
                <a href="../chapter2/2.html">
            
                    
                    2.2 创建布局文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter2/3.html">
            
                <a href="../chapter2/3.html">
            
                    
                    2.3 创建首页展示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter2/4.html">
            
                <a href="../chapter2/4.html">
            
                    
                    2.4 调整样式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="readme.html">
            
                <a href="readme.html">
            
                    
                    第三章 laravel组件的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="1.html">
            
                <a href="1.html">
            
                    
                    3.1 用户脚手架
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.2" data-path="2.html">
            
                <a href="2.html">
            
                    
                    3.2 注册验证码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="3.html">
            
                <a href="3.html">
            
                    
                    3.3 邮箱验证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="4.html">
            
                <a href="4.html">
            
                    
                    3.4 密码重置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter4/readme.html">
            
                <a href="../chapter4/readme.html">
            
                    
                    第四章 基础功能开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter4/1.html">
            
                <a href="../chapter4/1.html">
            
                    
                    4.1 个人页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter4/2.html">
            
                <a href="../chapter4/2.html">
            
                    
                    4.2 编辑个人资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../chapter4/3.html">
            
                <a href="../chapter4/3.html">
            
                    
                    4.3 显示个人资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../chapter4/4.html">
            
                <a href="../chapter4/4.html">
            
                    
                    4.4 上传头像
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter5/readme.html">
            
                <a href="../chapter5/readme.html">
            
                    
                    第五章 帖子功能开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter5/1.html">
            
                <a href="../chapter5/1.html">
            
                    
                    5.1 帖子分类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter5/2.html">
            
                <a href="../chapter5/2.html">
            
                    
                    5.2 代码生成器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter5/3.html">
            
                <a href="../chapter5/3.html">
            
                    
                    5.3 生成话题骨架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter5/4.html">
            
                <a href="../chapter5/4.html">
            
                    
                    5.4 假数据填充
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../chapter5/5.html">
            
                <a href="../chapter5/5.html">
            
                    
                    5.5 话题列表页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../chapter5/6.html">
            
                <a href="../chapter5/6.html">
            
                    
                    5.6 性能优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../chapter5/7.html">
            
                <a href="../chapter5/7.html">
            
                    
                    5.7 分类下的话题列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../chapter5/8.html">
            
                <a href="../chapter5/8.html">
            
                    
                    5.8 话题排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../chapter5/9.html">
            
                <a href="../chapter5/9.html">
            
                    
                    5.9 用户发布的话题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter6/readme.html">
            
                <a href="../chapter6/readme.html">
            
                    
                    第六章 话题开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter6/1.html">
            
                <a href="../chapter6/1.html">
            
                    
                    6.1 新建话题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter6/2.html">
            
                <a href="../chapter6/2.html">
            
                    
                    6.2 编辑器优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../chapter6/3.html">
            
                <a href="../chapter6/3.html">
            
                    
                    6.3 上传图片
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../chapter6/4.html">
            
                <a href="../chapter6/4.html">
            
                    
                    6.4 显示帖子
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../chapter6/5.html">
            
                <a href="../chapter6/5.html">
            
                    
                    6.5 XSS安全漏洞
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../chapter6/6.html">
            
                <a href="../chapter6/6.html">
            
                    
                    6.6 编辑帖子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3.2 注册验证码</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#32--&#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;"><b></b>3.2  &#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;</a></li><ul><li><span class="title-icon "></span><a href="#1-&#x5B89;&#x88C5;&#x6269;&#x5C55;&#x5305;"><b></b>1. &#x5B89;&#x88C5;&#x6269;&#x5C55;&#x5305;</a></li><ul><li><span class="title-icon "></span><a href="#&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x914D;&#x7F6E;&#x6587;&#x4EF6;configcaptchaphp"><b></b>&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x914D;&#x7F6E;&#x6587;&#x4EF6;config/captcha.php</a></li><li><span class="title-icon "></span><a href="#&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5F88;&#x7B80;&#x5355;"><b></b>&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5F88;&#x7B80;&#x5355;</a></li></ul><li><span class="title-icon "></span><a href="#2-&#x9875;&#x9762;&#x5D4C;&#x5165;"><b></b>2. &#x9875;&#x9762;&#x5D4C;&#x5165;</a></li><ul><li><span class="title-icon "></span><a href="#21--&#x524D;&#x6BB5;&#x5C55;&#x793A;"><b></b>2.1  &#x524D;&#x6BB5;&#x5C55;&#x793A;</a></li><li><span class="title-icon "></span><a href="#21-&#x540E;&#x7AEF;&#x9A8C;&#x8BC1;"><b></b>2.1 &#x540E;&#x7AEF;&#x9A8C;&#x8BC1;</a></li></ul></ul></ul></div><a href="#32--&#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="32--&#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;"><a name="32--&#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;" class="anchor-navigation-ex-anchor" href="#32--&#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="32--&#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;" class="plugin-anchor" href="#32--&#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;"><i class="fa fa-link" aria-hidden="true"></i></a>3.2  &#x6CE8;&#x518C;&#x9A8C;&#x8BC1;&#x7801;</h1>
<h2 id="1-&#x5B89;&#x88C5;&#x6269;&#x5C55;&#x5305;"><a name="1-&#x5B89;&#x88C5;&#x6269;&#x5C55;&#x5305;" class="anchor-navigation-ex-anchor" href="#1-&#x5B89;&#x88C5;&#x6269;&#x5C55;&#x5305;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="1-&#x5B89;&#x88C5;&#x6269;&#x5C55;&#x5305;" class="plugin-anchor" href="#1-&#x5B89;&#x88C5;&#x6269;&#x5C55;&#x5305;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x5B89;&#x88C5;&#x6269;&#x5C55;&#x5305;</h2>
<pre><code>vagrant@homestead:~/Code/kaleobbs$ composer require &quot;mews/captcha:~2.0&quot;
</code></pre><h3 id="&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x914D;&#x7F6E;&#x6587;&#x4EF6;configcaptchaphp"><a name="&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x914D;&#x7F6E;&#x6587;&#x4EF6;configcaptchaphp" class="anchor-navigation-ex-anchor" href="#&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x914D;&#x7F6E;&#x6587;&#x4EF6;configcaptchaphp"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x914D;&#x7F6E;&#x6587;&#x4EF6;configcaptchaphp" class="plugin-anchor" href="#&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x914D;&#x7F6E;&#x6587;&#x4EF6;configcaptchaphp"><i class="fa fa-link" aria-hidden="true"></i></a>&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x914D;&#x7F6E;&#x6587;&#x4EF6;config/captcha.php</h3>
<pre><code>vagrant@homestead:~/Code/kaleobbs$ php artisan vendor:publish --provider=&apos;Mews\Captcha\CaptchaServiceProvider&apos;
Copied File [/vendor/mews/captcha/config/captcha.php] To [/config/captcha.php]
Publishing complete.
</code></pre><h3 id="&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5F88;&#x7B80;&#x5355;"><a name="&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5F88;&#x7B80;&#x5355;" class="anchor-navigation-ex-anchor" href="#&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5F88;&#x7B80;&#x5355;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5F88;&#x7B80;&#x5355;" class="plugin-anchor" href="#&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5F88;&#x7B80;&#x5355;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5F88;&#x7B80;&#x5355;</h3>
<pre><code>&lt;?php

return [

    &apos;characters&apos; =&gt; &apos;2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ&apos;,

    &apos;default&apos;   =&gt; [
        &apos;length&apos;    =&gt; 9,
        &apos;width&apos;     =&gt; 120,
        &apos;height&apos;    =&gt; 36,
        &apos;quality&apos;   =&gt; 90,
        &apos;math&apos;      =&gt; true,
    ],

    &apos;flat&apos;   =&gt; [
        &apos;length&apos;    =&gt; 6,
        &apos;width&apos;     =&gt; 160,
        &apos;height&apos;    =&gt; 46,
        &apos;quality&apos;   =&gt; 90,
        &apos;lines&apos;     =&gt; 6,
        &apos;bgImage&apos;   =&gt; false,
        &apos;bgColor&apos;   =&gt; &apos;#ecf2f4&apos;,
        &apos;fontColors&apos;=&gt; [&apos;#2c3e50&apos;, &apos;#c0392b&apos;, &apos;#16a085&apos;, &apos;#c0392b&apos;, &apos;#8e44ad&apos;, &apos;#303f9f&apos;, &apos;#f57c00&apos;, &apos;#795548&apos;],
        &apos;contrast&apos;  =&gt; -5,
    ],

    &apos;mini&apos;   =&gt; [
        &apos;length&apos;    =&gt; 3,
        &apos;width&apos;     =&gt; 60,
        &apos;height&apos;    =&gt; 32,
    ],

    &apos;inverse&apos;   =&gt; [
        &apos;length&apos;    =&gt; 5,
        &apos;width&apos;     =&gt; 120,
        &apos;height&apos;    =&gt; 36,
        &apos;quality&apos;   =&gt; 90,
        &apos;sensitive&apos; =&gt; true,
        &apos;angle&apos;     =&gt; 12,
        &apos;sharpen&apos;   =&gt; 10,
        &apos;blur&apos;      =&gt; 2,
        &apos;invert&apos;    =&gt; true,
        &apos;contrast&apos;  =&gt; -5,
    ]

];
</code></pre><h2 id="2-&#x9875;&#x9762;&#x5D4C;&#x5165;"><a name="2-&#x9875;&#x9762;&#x5D4C;&#x5165;" class="anchor-navigation-ex-anchor" href="#2-&#x9875;&#x9762;&#x5D4C;&#x5165;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="2-&#x9875;&#x9762;&#x5D4C;&#x5165;" class="plugin-anchor" href="#2-&#x9875;&#x9762;&#x5D4C;&#x5165;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x9875;&#x9762;&#x5D4C;&#x5165;</h2>
<p>&#x6269;&#x5C55;&#x5305;&#x5206;&#x4E3A;&#x4E24;&#x6B65;:</p>
<ul>
<li><ol>
<li>&#x524D;&#x6BB5;&#x5C55;&#x793A;----&#x751F;&#x6210;&#x9A8C;&#x8BC1;&#x7801;&#x7ED9;&#x7528;&#x6237;&#x5C55;&#x793A;&#xFF0C;&#x5E76;&#x6536;&#x96C6;&#x7528;&#x6237;&#x8F93;&#x5165;&#x7684;&#x7B54;&#x6848;&#x3002;</li>
</ol>
</li>
<li><ol>
<li>&#x540E;&#x7AEF;&#x9A8C;&#x8BC1;----&#x63A5;&#x6536;&#x7B54;&#x6848;&#xFF0C;&#x68C0;&#x6D4B;&#x7528;&#x6237;&#x8F93;&#x5165;&#x7684;&#x9A8C;&#x8BC1;&#x7801;&#x662F;&#x5426;&#x6B63;&#x786E;&#x3002;<h3 id="21--&#x524D;&#x6BB5;&#x5C55;&#x793A;"><a name="21--&#x524D;&#x6BB5;&#x5C55;&#x793A;" class="anchor-navigation-ex-anchor" href="#21--&#x524D;&#x6BB5;&#x5C55;&#x793A;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="21--&#x524D;&#x6BB5;&#x5C55;&#x793A;" class="plugin-anchor" href="#21--&#x524D;&#x6BB5;&#x5C55;&#x793A;"><i class="fa fa-link" aria-hidden="true"></i></a>2.1  &#x524D;&#x6BB5;&#x5C55;&#x793A;</h3>
&#x4FEE;&#x6539;&#x6CE8;&#x518C;&#x9875;&#x9762;&#x6A21;&#x677F;&#x5982;&#x4E0B;:</li>
</ol>
</li>
</ul>
<pre><code>@extends(&apos;layouts.app&apos;)

@section(&apos;content&apos;)
&lt;div class=&quot;container&quot;&gt;
  &lt;div class=&quot;row justify-content-center&quot;&gt;
    &lt;div class=&quot;col-md-8&quot;&gt;
      &lt;div class=&quot;card&quot;&gt;
        &lt;div class=&quot;card-header&quot;&gt;{{ __(&apos;Register&apos;) }}&lt;/div&gt;

        &lt;div class=&quot;card-body&quot;&gt;
          &lt;form method=&quot;POST&quot; action=&quot;{{ route(&apos;register&apos;) }}&quot;&gt;
            @csrf

            &lt;div class=&quot;form-group row&quot;&gt;
              &lt;label for=&quot;name&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __(&apos;Name&apos;) }}&lt;/label&gt;

              &lt;div class=&quot;col-md-6&quot;&gt;
                &lt;input id=&quot;name&quot; type=&quot;text&quot; class=&quot;form-control{{ $errors-&gt;has(&apos;name&apos;) ? &apos; is-invalid&apos; : &apos;&apos; }}&quot; name=&quot;name&quot; value=&quot;{{ old(&apos;name&apos;) }}&quot; required autofocus&gt;

                @if ($errors-&gt;has(&apos;name&apos;))
                &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                  &lt;strong&gt;{{ $errors-&gt;first(&apos;name&apos;) }}&lt;/strong&gt;
                &lt;/span&gt;
                @endif
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class=&quot;form-group row&quot;&gt;
              &lt;label for=&quot;email&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __(&apos;E-Mail Address&apos;) }}&lt;/label&gt;

              &lt;div class=&quot;col-md-6&quot;&gt;
                &lt;input id=&quot;email&quot; type=&quot;email&quot; class=&quot;form-control{{ $errors-&gt;has(&apos;email&apos;) ? &apos; is-invalid&apos; : &apos;&apos; }}&quot; name=&quot;email&quot; value=&quot;{{ old(&apos;email&apos;) }}&quot; required&gt;

                @if ($errors-&gt;has(&apos;email&apos;))
                &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                  &lt;strong&gt;{{ $errors-&gt;first(&apos;email&apos;) }}&lt;/strong&gt;
                &lt;/span&gt;
                @endif
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class=&quot;form-group row&quot;&gt;
              &lt;label for=&quot;password&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __(&apos;Password&apos;) }}&lt;/label&gt;

              &lt;div class=&quot;col-md-6&quot;&gt;
                &lt;input id=&quot;password&quot; type=&quot;password&quot; class=&quot;form-control{{ $errors-&gt;has(&apos;password&apos;) ? &apos; is-invalid&apos; : &apos;&apos; }}&quot; name=&quot;password&quot; required&gt;

                @if ($errors-&gt;has(&apos;password&apos;))
                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                    &lt;strong&gt;{{ $errors-&gt;first(&apos;password&apos;) }}&lt;/strong&gt;
                  &lt;/span&gt;
                @endif
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class=&quot;form-group row&quot;&gt;
              &lt;label for=&quot;password-confirm&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __(&apos;Confirm Password&apos;) }}&lt;/label&gt;

              &lt;div class=&quot;col-md-6&quot;&gt;
                &lt;input id=&quot;password-confirm&quot; type=&quot;password&quot; class=&quot;form-control&quot; name=&quot;password_confirmation&quot; required&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class=&quot;form-group row&quot;&gt;
              &lt;label for=&quot;captcha&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;&#x9A8C;&#x8BC1;&#x7801;&lt;/label&gt;

              &lt;div class=&quot;col-md-6&quot;&gt;
                &lt;input id=&quot;captcha&quot; class=&quot;form-control{{ $errors-&gt;has(&apos;captcha&apos;) ? &apos; is-invalid&apos; : &apos;&apos; }}&quot; name=&quot;captcha&quot; required&gt;

                &lt;img class=&quot;thumbnail captcha mt-3 mb-2&quot; src=&quot;{{ captcha_src(&apos;flat&apos;) }}&quot; onclick=&quot;this.src=&apos;/captcha/flat?&apos;+Math.random()&quot; title=&quot;&#x70B9;&#x51FB;&#x56FE;&#x7247;&#x91CD;&#x65B0;&#x83B7;&#x53D6;&#x9A8C;&#x8BC1;&#x7801;&quot;&gt;

                @if ($errors-&gt;has(&apos;captcha&apos;))
                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                    &lt;strong&gt;{{ $errors-&gt;first(&apos;captcha&apos;) }}&lt;/strong&gt;
                  &lt;/span&gt;
                @endif
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class=&quot;form-group row mb-0&quot;&gt;
              &lt;div class=&quot;col-md-6 offset-md-4&quot;&gt;
                &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;
                  {{ __(&apos;Register&apos;) }}
                &lt;/button&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
@endsection
</code></pre><h4 id="&#x6253;&#x5F00;&#x67E5;&#x770B;&#x6548;&#x679C;&#x5982;&#x4E0B;"><a name="&#x6253;&#x5F00;&#x67E5;&#x770B;&#x6548;&#x679C;&#x5982;&#x4E0B;" class="anchor-navigation-ex-anchor" href="#&#x6253;&#x5F00;&#x67E5;&#x770B;&#x6548;&#x679C;&#x5982;&#x4E0B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x6253;&#x5F00;&#x67E5;&#x770B;&#x6548;&#x679C;&#x5982;&#x4E0B;" class="plugin-anchor" href="#&#x6253;&#x5F00;&#x67E5;&#x770B;&#x6548;&#x679C;&#x5982;&#x4E0B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6253;&#x5F00;&#x67E5;&#x770B;&#x6548;&#x679C;&#x5982;&#x4E0B;:</h4>
<p><img src="http://images.kaleozhou.top/3.2-01.png" alt="3.2-01.png"></p>
<h4 id="&#x8C03;&#x6574;&#x4E00;&#x4E0B;&#x6837;&#x5F0F;-resourcessassappscss"><a name="&#x8C03;&#x6574;&#x4E00;&#x4E0B;&#x6837;&#x5F0F;-resourcessassappscss" class="anchor-navigation-ex-anchor" href="#&#x8C03;&#x6574;&#x4E00;&#x4E0B;&#x6837;&#x5F0F;-resourcessassappscss"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x8C03;&#x6574;&#x4E00;&#x4E0B;&#x6837;&#x5F0F;-resourcessassappscss" class="plugin-anchor" href="#&#x8C03;&#x6574;&#x4E00;&#x4E0B;&#x6837;&#x5F0F;-resourcessassappscss"><i class="fa fa-link" aria-hidden="true"></i></a>&#x8C03;&#x6574;&#x4E00;&#x4E0B;&#x6837;&#x5F0F; resources/sass/app.scss</h4>
<pre><code>/*User register page*/
.register-page{
    img.captcha{
        curosr:prointer;
        border:1px solid #ced4da;
        border-radius:4px;
        padding:3px;
    }
</code></pre><p>&#x4FEE;&#x6539;&#x6837;&#x5F0F;&#x6587;&#x4EF6;&#x4E4B;&#x540E;&#xFF0C;&#x865A;&#x62DF;&#x673A;&#x8FD0;&#x884C;</p>
<pre><code>vagrant@homestead:~/Code/kaleobbs$ npm run watch-poll
</code></pre><p>&#x67E5;&#x770B;&#x6548;&#x679C;:</p>
<p><img src="http://images.kaleozhou.top/3.2-02.png" alt="3.2-02.png"></p>
<h3 id="21-&#x540E;&#x7AEF;&#x9A8C;&#x8BC1;"><a name="21-&#x540E;&#x7AEF;&#x9A8C;&#x8BC1;" class="anchor-navigation-ex-anchor" href="#21-&#x540E;&#x7AEF;&#x9A8C;&#x8BC1;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="21-&#x540E;&#x7AEF;&#x9A8C;&#x8BC1;" class="plugin-anchor" href="#21-&#x540E;&#x7AEF;&#x9A8C;&#x8BC1;"><i class="fa fa-link" aria-hidden="true"></i></a>2.1 &#x540E;&#x7AEF;&#x9A8C;&#x8BC1;</h3>
<p>mews/captcha &#x662F;&#x4E13;&#x95E8;&#x4E3A;laravel&#x91CF;&#x8EAB;&#x5B9A;&#x5236;&#x7684;&#x6269;&#x5C55;&#x5305;&#xFF0C;&#x80FD;&#x5F88;&#x597D;&#x7684;&#x517C;&#x5BB9;Laravel&#x751F;&#x6210;&#x7684;&#x6CE8;&#x518C;&#x903B;&#x8F91;&#xFF0C;&#x6211;&#x4EEC;&#x53EA;&#x9700;&#x8981;&#x5728;&#x6CE8;&#x518C;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6DFB;&#x52A0;&#x4E0A;&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x5C31;&#x53EF;&#x4EE5;&#x4E86;:
app/Http/Controllers/Auth/RegisterControll.php</p>
<pre><code>&lt;?php

namespace App\Http\Controllers\Auth;

use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

    /**
     * Where to redirect users after registration.
     *
     * @var string
     */
    protected $redirectTo = &apos;/&apos;;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this-&gt;middleware(&apos;guest&apos;);
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            &apos;name&apos; =&gt; [&apos;required&apos;, &apos;string&apos;, &apos;max:255&apos;],
            &apos;email&apos; =&gt; [&apos;required&apos;, &apos;string&apos;, &apos;email&apos;, &apos;max:255&apos;, &apos;unique:users&apos;],
            &apos;password&apos; =&gt; [&apos;required&apos;, &apos;string&apos;, &apos;min:6&apos;, &apos;confirmed&apos;],
            &apos;captcha&apos;=&gt;[&apos;required&apos;,&apos;captcha&apos;],

        ],[
            &apos;captcha.required&apos;=&gt;&apos;&#x9A8C;&#x8BC1;&#x7801;&#x4E0D;&#x80FD;&#x4E3A;&#x7A7A;&apos;,
            &apos;captcha.captcha&apos;=&gt;&apos;&#x8BF7;&#x8F93;&#x5165;&#x6B63;&#x786E;&#x7684;&#x9A8C;&#x8BC1;&#x7801;&apos;,

        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return \App\User
     */
    protected function create(array $data)
    {
        return User::create([
            &apos;name&apos; =&gt; $data[&apos;name&apos;],
            &apos;email&apos; =&gt; $data[&apos;email&apos;],
            &apos;password&apos; =&gt; Hash::make($data[&apos;password&apos;]),
        ]);
    }
}
</code></pre><h4 id="&#x6D4B;&#x8BD5;&#x5206;&#x522B;&#x8F93;&#x5165;&#x9519;&#x8BEF;&#x7684;&#x548C;&#x6B63;&#x786E;&#x7684;&#x9A8C;&#x8BC1;&#x7801;"><a name="&#x6D4B;&#x8BD5;&#x5206;&#x522B;&#x8F93;&#x5165;&#x9519;&#x8BEF;&#x7684;&#x548C;&#x6B63;&#x786E;&#x7684;&#x9A8C;&#x8BC1;&#x7801;" class="anchor-navigation-ex-anchor" href="#&#x6D4B;&#x8BD5;&#x5206;&#x522B;&#x8F93;&#x5165;&#x9519;&#x8BEF;&#x7684;&#x548C;&#x6B63;&#x786E;&#x7684;&#x9A8C;&#x8BC1;&#x7801;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x6D4B;&#x8BD5;&#x5206;&#x522B;&#x8F93;&#x5165;&#x9519;&#x8BEF;&#x7684;&#x548C;&#x6B63;&#x786E;&#x7684;&#x9A8C;&#x8BC1;&#x7801;" class="plugin-anchor" href="#&#x6D4B;&#x8BD5;&#x5206;&#x522B;&#x8F93;&#x5165;&#x9519;&#x8BEF;&#x7684;&#x548C;&#x6B63;&#x786E;&#x7684;&#x9A8C;&#x8BC1;&#x7801;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6D4B;&#x8BD5;&#x5206;&#x522B;&#x8F93;&#x5165;&#x9519;&#x8BEF;&#x7684;&#x548C;&#x6B63;&#x786E;&#x7684;&#x9A8C;&#x8BC1;&#x7801;</h4>
<p><img src="http://images.kaleozhou.top/3.2-03.png" alt="3.2-03.png">
<img src="http://images.kaleozhou.top/3.2-04.png" alt="3.2-04.png"></p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; kaleozhou 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-05-20 16:22:47
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="1.html" class="navigation navigation-prev " aria-label="Previous page: 3.1 用户脚手架">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="3.html" class="navigation navigation-next " aria-label="Next page: 3.3 邮箱验证">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3.2 注册验证码","level":"1.4.2","depth":2,"next":{"title":"3.3 邮箱验证","level":"1.4.3","depth":2,"path":"chapter3/3.md","ref":"chapter3/3.md","articles":[]},"previous":{"title":"3.1 用户脚手架","level":"1.4.1","depth":2,"path":"chapter3/1.md","ref":"chapter3/1.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","splitter","expandable-chapters-small","anchors","donate","sharing-plus","anchor-navigation-ex","tbfed-pagefooter","favicon"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy kaleozhou 2019","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"github":{"url":"https://gitee.com/kaleozhou"},"splitter":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"donate":{"alipay":"http://images.kaleozhou.top/zanshang.png","alipayText":" ","button":"赞赏","title":"","wechat":"","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":false},"favicon":{"shortcut":"./book.ico","bookmark":"./book.ico","appleTouch":"./book.ico","appleTouchMore":{"120x120":"./book.ico","180x180":"./book.ico"}},"github-buttons":{"buttons":[{"user":"kaleozhou","repo":"guanwang","type":"star","size":"small","count":true}]},"expandable-chapters-small":{},"sharing":{"qq":true,"all":["weibo","qq","qzone"],"douban":true,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"theme":"default","author":"kaleozhou","pdf":{"pageBreaksBefore":"/","paperSize":"a4","margin":{"right":30,"left":30,"top":30,"bottom":50},"fontSize":18,"pageSize":"a4","fontFamily":"Arial","doc":true,"chapterMark":"pagebreak","pageNumbers":true},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Laravel学习-从零开发论坛系统","language":"zh-hans","links":{"sidebar":{"我的博客":"http://www.kaleozhou.top"}},"gitbook":"3.2.3","description":"laravel框架开发论坛系统"},"file":{"path":"chapter3/2.md","mtime":"2019-05-20T08:22:47.652Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-25T02:56:39.861Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

